From 0a80b63b06c3e215754215aaf775f32d59f8b27f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 5 Nov 2003 20:05:47 +0000 Subject: [PATCH] Change the ranges for Saturation and Value to be 0-100 instead of 0-255, Wed Nov 5 21:02:26 2003 Matthias Clasen * gtk/gtkcolorsel.c (update_color): (make_label_spinbutton): (adjustment_changed): Change the ranges for Saturation and Value to be 0-100 instead of 0-255, since these axes of HSV are usually expressed in percent. (#121519, Gregory Merchan) Wed Nov 5 21:02:26 2003 Matthias Clasen * gtk/gtkcolorsel.c (update_color): (make_label_spinbutton): (adjustment_changed): Change the ranges for Saturation and Value to be 0-100 instead of 0-255, since these axes of HSV are usually expressed in percent. (#121519, Gregory Merchan) --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ gtk/gtkcolorsel.c | 11 ++++++++--- 6 files changed, 48 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index af3167ab73..8d52ab3c08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Nov 5 21:02:26 2003 Matthias Clasen + + * gtk/gtkcolorsel.c (update_color): + (make_label_spinbutton): + (adjustment_changed): Change the ranges for Saturation and + Value to be 0-100 instead of 0-255, since these axes of HSV + are usually expressed in percent. (#121519, Gregory Merchan) + Wed Nov 5 08:51:48 GMT 2003 Tony Gale * docs/faq/gtk-faq.sgml: More 2.x updates diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index af3167ab73..8d52ab3c08 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Wed Nov 5 21:02:26 2003 Matthias Clasen + + * gtk/gtkcolorsel.c (update_color): + (make_label_spinbutton): + (adjustment_changed): Change the ranges for Saturation and + Value to be 0-100 instead of 0-255, since these axes of HSV + are usually expressed in percent. (#121519, Gregory Merchan) + Wed Nov 5 08:51:48 GMT 2003 Tony Gale * docs/faq/gtk-faq.sgml: More 2.x updates diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index af3167ab73..8d52ab3c08 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Wed Nov 5 21:02:26 2003 Matthias Clasen + + * gtk/gtkcolorsel.c (update_color): + (make_label_spinbutton): + (adjustment_changed): Change the ranges for Saturation and + Value to be 0-100 instead of 0-255, since these axes of HSV + are usually expressed in percent. (#121519, Gregory Merchan) + Wed Nov 5 08:51:48 GMT 2003 Tony Gale * docs/faq/gtk-faq.sgml: More 2.x updates diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index af3167ab73..8d52ab3c08 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Wed Nov 5 21:02:26 2003 Matthias Clasen + + * gtk/gtkcolorsel.c (update_color): + (make_label_spinbutton): + (adjustment_changed): Change the ranges for Saturation and + Value to be 0-100 instead of 0-255, since these axes of HSV + are usually expressed in percent. (#121519, Gregory Merchan) + Wed Nov 5 08:51:48 GMT 2003 Tony Gale * docs/faq/gtk-faq.sgml: More 2.x updates diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index af3167ab73..8d52ab3c08 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Wed Nov 5 21:02:26 2003 Matthias Clasen + + * gtk/gtkcolorsel.c (update_color): + (make_label_spinbutton): + (adjustment_changed): Change the ranges for Saturation and + Value to be 0-100 instead of 0-255, since these axes of HSV + are usually expressed in percent. (#121519, Gregory Merchan) + Wed Nov 5 08:51:48 GMT 2003 Tony Gale * docs/faq/gtk-faq.sgml: More 2.x updates diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c index e7a191a042..e568243699 100644 --- a/gtk/gtkcolorsel.c +++ b/gtk/gtkcolorsel.c @@ -1445,7 +1445,7 @@ adjustment_changed (GtkAdjustment *adjustment, { case COLORSEL_SATURATION: case COLORSEL_VALUE: - priv->color[GPOINTER_TO_INT (data)] = adjustment->value / 255; + priv->color[GPOINTER_TO_INT (data)] = adjustment->value / 100; gtk_hsv_to_rgb (priv->color[COLORSEL_HUE], priv->color[COLORSEL_SATURATION], priv->color[COLORSEL_VALUE], @@ -1523,6 +1523,11 @@ make_label_spinbutton (GtkColorSelection *colorsel, { adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 1.0, 1.0)); } + else if (channel_type == COLORSEL_SATURATION || + channel_type == COLORSEL_VALUE) + { + adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 100.0, 1.0, 1.0, 1.0)); + } else { adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 1.0)); @@ -1599,10 +1604,10 @@ update_color (GtkColorSelection *colorsel) scale_round (priv->color[COLORSEL_HUE], 360)); gtk_adjustment_set_value (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->sat_spinbutton)), - scale_round (priv->color[COLORSEL_SATURATION], 255)); + scale_round (priv->color[COLORSEL_SATURATION], 100)); gtk_adjustment_set_value (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->val_spinbutton)), - scale_round (priv->color[COLORSEL_VALUE], 255)); + scale_round (priv->color[COLORSEL_VALUE], 100)); gtk_adjustment_set_value (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->red_spinbutton)), scale_round (priv->color[COLORSEL_RED], 255)); -- 2.30.2